package com.hyacinth.cloudnote.common.security;

import com.hyacinth.cloudnote.common.enums.UserStatus;
import lombok.AccessLevel;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.UUID;

/**
 * 用户凭证信息
 *
 * @author zhangfb
 * @version 1.0.0.1
 * @since JDK 1.8
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Data
public class UserPrincipal implements Serializable {

    private static final long serialVersionUID = 1750420614873555393L;

    private UUID id;

    /**
     * 用户账号
     */
    private String username;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 邮箱（登录凭证）
     */
    private String email;

    /**
     * 真实姓名
     */
    private String realName;

    /**
     * 用户状态
     */
    private UserStatus status;

    /**
     * 头像
     */
    private String portrait;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    public UserPrincipal(UUID id, String username, String mobile, String email, String realName, UserStatus status, String portrait) {
        this.id = id;
        this.username = username;
        this.mobile = mobile;
        this.email = email;
        this.realName = realName;
        this.status = status;
        this.portrait = portrait;
        this.createTime = LocalDateTime.now();
    }

}